package com.kai.service.data.request.upload;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Schema(description = "创建分片任务请求参数")
public class UploadTaskRequest {

    /**
     * 文件唯一标识(MD5)
     */
    @Schema(description = "文件唯一标识(MD5)",  requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "文件标识不能为空")
    String fileIdentifier;

    /**
     * 文件大小（byte）
     */
    @Schema(description = "文件大小（byte）",  requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "文件大小不能为空")
    Long totalSize;

    /**
     * 分片大小（byte）
     */
    @Schema(description = "分片大小（byte）",  requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "分片大小不能为空")
    Long chunkSize;

    /**
     * 文件名称
     */
    @Schema(description = "文件名称",  requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "文件名称不能为空")
    String fileName;
}
